package com.kexio.pay.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 支付宝配置属性
 * 
 * 配置文件: application-pay.yml
 * 
 * @author Kexio Team
 */
@Component
@ConfigurationProperties(prefix = "alipay")
public class AliPayProperties {
    
    /**
     * 应用ID
     */
    private String appId;
    
    /**
     * 应用私钥（PKCS8格式）
     */
    private String privateKey;
    
    /**
     * 支付宝公钥
     */
    private String publicKey;
    
    /**
     * 支付宝网关地址
     */
    private String serverUrl;
    
    /**
     * 字符集，默认UTF-8
     */
    private String charset = "UTF-8";
    
    /**
     * 签名类型，默认RSA2
     */
    private String signType = "RSA2";
    
    /**
     * 数据格式，默认JSON
     */
    private String format = "json";
    
    /**
     * 外网访问域名（用于回调）
     */
    private String domain;
    
    /**
     * 应用公钥证书路径（证书模式）
     */
    private String appCertPath;
    
    /**
     * 支付宝公钥证书路径（证书模式）
     */
    private String aliPayCertPath;
    
    /**
     * 支付宝根证书路径（证书模式）
     */
    private String aliPayRootCertPath;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    public String getPublicKey() {
        return publicKey;
    }

    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getAppCertPath() {
        return appCertPath;
    }

    public void setAppCertPath(String appCertPath) {
        this.appCertPath = appCertPath;
    }

    public String getAliPayCertPath() {
        return aliPayCertPath;
    }

    public void setAliPayCertPath(String aliPayCertPath) {
        this.aliPayCertPath = aliPayCertPath;
    }

    public String getAliPayRootCertPath() {
        return aliPayRootCertPath;
    }

    public void setAliPayRootCertPath(String aliPayRootCertPath) {
        this.aliPayRootCertPath = aliPayRootCertPath;
    }

    @Override
    public String toString() {
        return "AliPayProperties{" +
                "appId='" + appId + '\'' +
                ", serverUrl='" + serverUrl + '\'' +
                ", charset='" + charset + '\'' +
                ", signType='" + signType + '\'' +
                ", format='" + format + '\'' +
                ", domain='" + domain + '\'' +
                '}';
    }
}

